/*
 *	This file is part of Lounge-Cast.
 *
 *  Author:  	Markus Moormann
 *	E-mail:  	mmoorman@uni-osnabrueck.de
 *	Copyright:	University of Osnabrueck (Zentrum Virtuos)
 * 	Website:	www.uni-osnabrueck.de
 *	Date:		16.02.2011
 *
 *	Lounge-Cast is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *	Lounge-Cast is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Lounge-Cast.  If not, see <http://www.gnu.org/licenses/>.
 */
package webservice.vo;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * class representing a MediaVO
 * this is the base class for all other media classes such 
 * as Image, Slide, Text or Video
 * 
 * @author Markus Moormann
 */
@XmlRootElement(name = "Media")
public class Media {

	/**
	 * the id of the media;
	 */
	@XmlElement(name="mediaId")
	public String media_id;
	/**
	 * type of media ('video'|'slide'|'text'|'image')
	 */
	@XmlElement(name="type")
	public String type;
	/**
	 * title of the media
	 */
	@XmlElement(name="title")
	public String title;
	/**
	 * start date from when media is valid
	 */
	@XmlElement(name="start_date")
	public long start_date;
	/**
	 * valid date till when media is valid
	 */
	@XmlElement(name="validDate")
	public long valid_date;
	/**
	 * newsticker allowed or not
	 */
	@XmlElement(name="newsticker")
	public boolean newsticker;
	/**
	 * duration of media
	 */
	@XmlElement(name="duration")
	public long duration;
	/**
	 * further reference
	 */
	@XmlElement(name="reference")
	public String reference;
	
	@XmlElement(name="hide_title")
	public String hide_title;
	
	@XmlElement(name="title_color")
	public int title_color;
	
	public String feed_item_uri;
	
	/**
	 * default constructor
	 */
	public Media(){}
	
	/**
	 * constructor 
	 * 
	 * @param media_id the id of the media
	 * @param type the type of the media ('video'|'slide'|'text'|'image')
	 * @param title the title of the media
	 * @param valid_date a date till when the media is valid
	 * @param newsticker whether newsticker below the media is allowed or not
	 * @param duration the duration of the media (not so important for videos
	 * @param reference an URL for further reference
	 */
	public Media(String media_id, 
				   String type, 
				   String title, 
				   long start_date,
				   long valid_date,
				   boolean newsticker,
				   long duration,
				   String reference) {
		this.media_id = media_id;
		this.type = type;
		this.title = title;
		this.start_date = start_date;
		this.valid_date = valid_date;
		this.newsticker = newsticker;
		this.duration = duration;
		this.reference = reference;
	}
	
	/**
	 * clones the media 
	 * 
	 * @return new instance of the media containing the same data
	 */
	public Media clone()
	{
		Media media = new Media(media_id,
								type,
								title,
								start_date,
								valid_date,
								newsticker,
								duration,
								reference);
		return media;
	}
	
}
